//++++++++++++++++++++++++++++++++++++++++
// 《Go语言高级开发与实战》源码
//++++++++++++++++++++++++++++++++++++++++
// Author:廖显东（ShirDon）
// Blog:https://www.shirdon.com/
// 知乎：https://www.zhihu.com/people/shirdonl
// 公众号:源码大数据
// 仓库地址：https://gitee.com/shirdonl/goAdvanced
// 仓库地址：https://github.com/shirdonl/goAdvanced
//++++++++++++++++++++++++++++++++++++++++

package main

import (
	"fmt"
	"sort"
)

type Programmer struct {
	FirstName string
	GoodAt    string
}

func main() {
	members := []Programmer{
		{"Jack", "PHP"},
		{"Jane", "JAVA"},
		{"Barry", "Go"},
	}

	fmt.Println(members)

	sort.Slice(members, func(i, j int) bool {
		return members[i].GoodAt < members[j].GoodAt || members[i].FirstName < members[j].FirstName
	})

	fmt.Println(members)
}
